.TH "C:/Users/Matt/Documents/School/Robotics/zebulon/v2/vision/ext/SIFT/utils.h" 3 "13 Oct 2009" "Version 2" "zebulon" \" -*- nroff -*-
.ad l
.nh
.SH NAME
C:/Users/Matt/Documents/School/Robotics/zebulon/v2/vision/ext/SIFT/utils.h \- 
.SH SYNOPSIS
.br
.PP
\fC#include 'cxcore.h'\fP
.br
\fC#include <stdio.h>\fP
.br

.SS "Defines"

.in +1c
.ti -1c
.RI "#define \fBABS\fP(x)   ( ( x < 0 )? -x : x )"
.br
.in -1c
.SS "Functions"

.in +1c
.ti -1c
.RI "void \fBfatal_error\fP (char *format,...)"
.br
.ti -1c
.RI "char * \fBreplace_extension\fP (const char *file, const char *extn)"
.br
.ti -1c
.RI "char * \fBbasename\fP (const char *pathname)"
.br
.ti -1c
.RI "void \fBprogress\fP (int done)"
.br
.ti -1c
.RI "void \fBerase_from_stream\fP (FILE *stream, int n)"
.br
.ti -1c
.RI "int \fBarray_double\fP (void **array, int n, int size)"
.br
.ti -1c
.RI "double \fBdist_sq_2D\fP (CvPoint2D64f p1, CvPoint2D64f p2)"
.br
.ti -1c
.RI "void \fBdraw_x\fP (IplImage *img, CvPoint pt, int r, int w, CvScalar color)"
.br
.ti -1c
.RI "IplImage * \fBstack_imgs\fP (IplImage *img1, IplImage *img2)"
.br
.ti -1c
.RI "void \fBvid_view\fP (IplImage **imgs, int n, char *win_name)"
.br
.ti -1c
.RI "int \fBwin_closed\fP (char *name)"
.br
.in -1c
.SH "Detailed Description"
.PP 
Miscellaneous utility functions.
.PP
Copyright (C) 2006 Rob Hess <hess@eecs.oregonstate.edu>
.PP
\fBVersion:\fP
.RS 4
1.1.1-20070913 
.RE
.PP

.SH "Function Documentation"
.PP 
.SS "int array_double (void ** array, int n, int size)"Doubles the size of an array with error checking
.PP
\fBParameters:\fP
.RS 4
\fIarray\fP pointer to an array whose size is to be doubled 
.br
\fIn\fP number of elements allocated for \fIarray\fP 
.br
\fIsize\fP size in bytes of elements in \fIarray\fP 
.RE
.PP
\fBReturns:\fP
.RS 4
Returns the new number of elements allocated for \fIarray\fP. If no memory is available, returns 0 and frees array. 
.RE
.PP

.SS "char* basename (const char * pathname)"A function that removes the path from a filename. Similar to the Unix basename command.
.PP
\fBParameters:\fP
.RS 4
\fIpathname\fP a (full) path name
.RE
.PP
\fBReturns:\fP
.RS 4
Returns the basename of \fIpathname\fP. 
.RE
.PP

.SS "double dist_sq_2D (CvPoint2D64f p1, CvPoint2D64f p2)"Calculates the squared distance between two points.
.PP
\fBParameters:\fP
.RS 4
\fIp1\fP a point 
.br
\fIp2\fP another point 
.RE
.PP

.SS "void draw_x (IplImage * img, CvPoint pt, int r, int w, CvScalar color)"Draws an x on an image.
.PP
\fBParameters:\fP
.RS 4
\fIimg\fP an image 
.br
\fIpt\fP the center point of the x 
.br
\fIr\fP the x's radius 
.br
\fIw\fP the x's line weight 
.br
\fIcolor\fP the color of the x 
.RE
.PP

.SS "void erase_from_stream (FILE * stream, int n)"Erases a specified number of characters from a stream.
.PP
\fBParameters:\fP
.RS 4
\fIstream\fP the stream from which to erase characters 
.br
\fIn\fP the number of characters to erase 
.RE
.PP

.SS "void fatal_error (char * format,  ...)"Prints an error message and aborts the program. The error message is of the form 'Error: ...', where the ... is specified by the \fIformat\fP argument
.PP
\fBParameters:\fP
.RS 4
\fIformat\fP an error message format string (as with \fCprintf(3)\fP). 
.RE
.PP

.SS "void progress (int done)"Displays progress in the console with a spinning pinwheel. Every time this function is called, the state of the pinwheel is incremented. The pinwheel has four states that loop indefinitely: '|', '/', '-', '\\'.
.PP
\fBParameters:\fP
.RS 4
\fIdone\fP if 0, this function simply increments the state of the pinwheel; otherwise it prints 'done' 
.RE
.PP

.SS "char* replace_extension (const char * file, const char * extn)"Replaces a file's extension, which is assumed to be everything after the last dot ('.') character.
.PP
\fBParameters:\fP
.RS 4
\fIfile\fP the name of a file
.br
\fIextn\fP a new extension for \fIfile\fP; should not include a dot (i.e. \fC'jpg'\fP, not \fC'.jpg'\fP) unless the new file extension should contain two dots.
.RE
.PP
\fBReturns:\fP
.RS 4
Returns a new string formed as described above. If \fIfile\fP does not have an extension, this function simply adds one. 
.RE
.PP

.SS "IplImage* stack_imgs (IplImage * img1, IplImage * img2)"Combines two images by scacking one on top of the other
.PP
\fBParameters:\fP
.RS 4
\fIimg1\fP top image 
.br
\fIimg2\fP bottom image
.RE
.PP
\fBReturns:\fP
.RS 4
Returns the image resulting from stacking \fIimg1\fP on top if \fIimg2\fP 
.RE
.PP

.SS "void vid_view (IplImage ** imgs, int n, char * win_name)"Allows user to view an array of images as a video. Keyboard controls are as follows:
.PP
.PD 0
.IP "\(bu" 2
Space - start and pause playback 
.IP "\(bu" 2
Page Up - skip forward 10 frames 
.IP "\(bu" 2
Page Down - jump back 10 frames 
.IP "\(bu" 2
Right Arrow - skip forward 1 frame 
.IP "\(bu" 2
Left Arrow - jump back 1 frame 
.IP "\(bu" 2
Backspace - jump back to beginning 
.IP "\(bu" 2
Esc - exit playback 
.IP "\(bu" 2
Closing the window also exits playback 
.PP
.PP
\fBParameters:\fP
.RS 4
\fIimgs\fP an array of images 
.br
\fIn\fP number of images in \fIimgs\fP 
.br
\fIwin_name\fP name of window in which images are displayed 
.RE
.PP

.SS "int win_closed (char * name)"Checks if a HighGUI window is still open or not
.PP
\fBParameters:\fP
.RS 4
\fIname\fP the name of the window we're checking
.RE
.PP
\fBReturns:\fP
.RS 4
Returns 1 if the window named \fIname\fP has been closed or 0 otherwise 
.RE
.PP

.SH "Author"
.PP 
Generated automatically by Doxygen for zebulon from the source code.
